home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2709 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: news.mindlink.net!news
  2. From: genew@mindlink.bc.ca (Gene Wirchenko)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Hungarian notation
  5. Date: Fri, 19 Jan 1996 06:53:04 GMT
  6. Organization: MIND LINK! - British Columbia, Canada
  7. Message-ID: <4dnf74$1sa@fountain.mindlink.net>
  8. References: <4dhkae$an9@blackice.winternet.com> <821890870snz@genesis.demon.co.uk> <30fd5306.3171520@nntp.ix.netcom.com> <9601181211.AA03705@dxmint.cern.ch>
  9. NNTP-Posting-Host: line121.nwm.mindlink.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Dan Pop <danpop@mail.cern.ch> wrote:
  13.  
  14. >miker3@ix.netcom.com (Mike Rubenstein) writes:
  15.  
  16. >>There is one possibility that makes the cast to long double
  17. >>potentially dangerous according to the standard.  There is no
  18. >>guarantee in the standard that all possible values of an integral type
  19. >>can be converted to long double.
  20.  
  21. >Such a guarantee actually exists.  
  22.  
  23. >    (ANSI classic) 3.2.1.5 Usual arithmetic conversions
  24.  
  25. >    Many binary operators that expect operands of arithmetic type cause
  26. >    conversions and yield result types in a similar way.  The purpose is
  27. >    to yield a common type, which is also the type of the result.  This
  28. >    pattern is called the usual arithmetic conversions: First, if either
  29. >    operand has type long double, the other operand is converted to long
  30. >    double.
  31.  
  32. >The last statement (sort of) guarantees that any arithmetic type can be
  33. >safely converted to long double, even if some information is lost in the
  34. >conversion (I'm typing this text on a machine where both long and long
  35.  
  36.      I don't understand this, Dan.
  37.      "...safely converted..." and "...even if some information is lost
  38. in the conversion..." don't go together in my understanding.
  39.      Do you simply mean that C won't barf or that the program won't
  40. crash?  Or what?
  41.  
  42. >double have the same size, hence some long values cannot be converted to
  43. >long double without loss of precision).
  44.  
  45. >Dan
  46. >-- 
  47. >Dan Pop
  48. >CERN, CN Division
  49. >Email: danpop@mail.cern.ch 
  50. >Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  51.  
  52. Sincerely,
  53.  
  54. Gene Wirchenko
  55.  
  56. C Pronunciation Guide:
  57.      y=x++;     "wye equals ex plus plus semicolon"
  58.      x=x++;     "ex equals ex doublecross semicolon"
  59.  
  60.